<?php
class FileManageAction extends LVAction
{
	var $module_name =  array("截关信息动态","文档管理");
	var $model = "FileManage" ;
	//var $list_template = "FileManage/new_notice";
	
	public function index(){
		$this->display("FileManage/port");
	}
	
		/**
	 * show
	 * @access public 
	 * @return void
	 */
	public function show(){
		$instance = new Model ($this->model);
		import("ORG.Util.Page");
		$count = $instance->where('state = 1')->count();
		$Page = new Page($count,10);
		$show = $Page->show();
		$list = $instance->where('state = 1')->limit($Page->firstRow.','.$Page->listRows)->order("id desc")->select();
		$this->assign("list",$list);
		$this->assign("show",$show);
		$this->display("FileManage/portfile_list");
		}
	/**
	 * view
	 * @access public 
	 * @return void
	 */
	public function view(){
		if(!empty($_GET['id'])){
			$instance = new Model ($this->model);
			$list = $instance->GetById($_GET['id']);
			if($list){
				$this->assign("list",$list);
				$this->display("FileManage/portfile_detail");
			}else{
				$this->error("查看项不存在");
			}
		}else{
			$this->error("非法操作");
		}
	}
	//页面打开时首先展示的文章
	public function view_first(){
		$this->model = M($this->model);
		$list = $this->model->find();
		if($list){
			$this->assign("list",$list);
			$this->display("FileManage/portfile_detail");
		}else{
			$this->error("查看项不存在");
		}
	}
}
?>
